﻿namespace TomatoBreak.DataAccess
{
    using System;
    using System.Linq;
    using System.Linq.Expressions;

    using DomainObjects;

    public interface IRepository<T> where T : Entity
    {
        void Add(T instance);

        void Update(T instance);

        void Remove(T instance);

        bool Exists(Expression<Func<T, bool>> predicate);

        int Count();

        int Count(Expression<Func<T, bool>> predicate);

        T One(Guid id);

        T FindOne(Expression<Func<T, bool>> predicate);

        IQueryable<T> FindAll(Expression<Func<T, bool>> predicate);

        IQueryable<T> All();
    }
}